<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<script>
	$(document)
			.ready(
					function() {
						$('#btnBack')
								.click(
										function() {
											document.demoForm.action = "${basePath}/demo/indexDemo";
											document.demoForm.submit();
										});

						$("#div1").dialog({
							width : 'auto',
							height : 'auto',
							bgiframe : true,
							modal : true,
							draggable : true,
							resizable : false,
							title : '选择学生',
							autoOpen : false,
						    buttons : {
						    '取消' : function() {
						    	$(this).dialog('close');
							},
							'确定' : function() {
							  if($("#fromSelect").val()==null||$("#fromSelect").val()==""){
								 alert("请选择一项");
								 return false;
							  }
							  $("#name").val($("#fromSelect").find("option:selected").text());
							  $(this).dialog('close');
							  
							}
						  }
						});

					});
	function showdiv() {
		$('#div1').dialog('open');
	}
</script>
</head>
<body>
	<form action="#" id="demoForm" name="demoForm">
		<input type="hidden" name="token" value="${token}" />	
		<table cellpadding="0" cellspacing="0" border="0" class="table-border"
			width="80%">
			<tr>
				<td class="table-header" colspan="2">xxxx信息</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width:12%"><font
					style="color: red;">*</font>姓名：</td>
				<td class="table-contentTD" style="width:22%"><input
					type="text" id="name" name="name" value="" maxlength="100" class="inputText required"/>&nbsp&nbsp;<input
					type="button" id="optionBtn" value="选择" class="inputButton"
					onclick="javascript:showdiv();" placeholder="请选择学生"/></td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width:12%"><font style="color: red;">*</font>年龄：</td>
				<td class="table-contentTD" style="width:22%"><input type="text" id="age"
					name="age" value="" class="inputText required"  placeholder="请输入年龄"/></td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width:12%">成绩：</td>
				<td class="table-contentTD" style="width:22%"><input type="text" id="score"
					name="score" value="" class="inputText required" placeholder="请输入成绩"/></td>
			</tr>
		</table>
		<br />
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<tr>
			    <td><input type="button" id="btnSave" autocomplete="off"  class="inputButton"
					style="text-align: center;" value="保存" /></td>
				<td><input type="button" id="btnSave" autocomplete="off"   class="inputButton"
					style="text-align: center;" value="保存并新增" /></td>
				<td><input type="button" id="btnSave" autocomplete="off"  class="inputButton"
					style="text-align: center;" value="取消" /></td>
				<td><input type="button" id="btnBack" autocomplete="off"  class="inputButton"
					value="返回" style="text-align: center;" /></td>
			</tr>
		</table>

		<div id="div1" style="display: none;">
			<table cellpadding="0" cellspacing="0" border="0"
				class="table-border">
				
				  <tr>
  	 <td style="clear:both; width: 45%">
  	  <input class="text" name="searchemp" ondblclick="javascript:filterSelectItems('sourseFromSelect2','fromSelect','fromSelect',this.value);"  onkeyup="javascript:filterSelectItems('sourseFromSelect2','fromSelect','fromSelect',this.value);"/><font color="green">在此查找</font> <br/>
  	   <br/><label style="color:red;">未选中:</label><br/>
  	   <select name="fromSelect" id="fromSelect" multiple="multiple" class="inputText" style="width:220px; height: 300px;"
			ondblclick="moveField('fromSelect','toSelect');">
						<option value="1">xxxxxx</option>
						<option value="2">xxxxxx</option>
						<option value="3">xxxxxx</option>
						<option value="4">xxxxxx</option>
						<option value="5">xxxxxx</option>
						<option value="6">xxxxxx</option>
		</select>
		<select name="sourseFromSelect2" id="sourseFromSelect2" multiple="multiple" style="width: 220px; height: 150px; display: none;" >
		<option value="1">xxxxxx</option>
						<option value="2">xxxxxx</option>
						<option value="3">xxxxxx</option>
						<option value="4">xxxxxx</option>
						<option value="5">xxxxxx</option>
						<option value="6">xxxxxx</option>
  	    </select>
  	    </td>
  	    <td align="center" style="width: 10%">
  	    <input type="button"  onclick="moveAllField('fromSelect','toSelect');" style="width: 40px;" value=">>"   class="inputButton"/>
		<br>
		 <br/>
		<input type="button"  class="inputButton"
			onclick="moveField('fromSelect','toSelect');"
			style="width: 40px;" value=">" />
	   <br/>
	    <br/>
		<input type="button"   style="width: 40px;" value="&lt"  class="inputButton" onclick="moveField('toSelect','fromSelect');"/><br/> <br/>
     	<input type="button" style="width: 40px;"  class="inputButton" onclick="moveAllField('toSelect','fromSelect');"  value="&lt&lt" />
     </td>
     <td style="width: 45%"><br/><br/><label style="color:red;">已选中:</label><br/>
     <select name="toSelect" id="toSelect" multiple="multiple"  class="inputText"   style="width:220px;height: 300px;" ondblclick="moveField('toSelect','fromSelect');">
		</select>
     </td>
  	    
  	   </tr>
			</table>
		</div>
		
	</form>
</body>
</html>
